#ifndef ORDER_WIDGET_LOGIC_H
#define ORDER_WIDGET_LOGIC_H

#include <QObject>
#include <QVector>
#include "order_widget_ui.h"

class OrderWidgetLogic : public QObject
{
    Q_OBJECT

public:
    explicit OrderWidgetLogic(OrderWidgetUI *ui, QObject *parent = nullptr);
    ~OrderWidgetLogic();

    void addProduct(double price, int quantity);

private:
    OrderWidgetUI *ui;
    QVector<QPair<double, int>> products;

    double calculateTotalAmount();
};

#endif // ORDER_WIDGET_LOGIC_H
